<template>
  <div id="NewsInformation">
    <div class="container">
      <div class="row_bw warp" style="width: 100%">
        <div v-if="is_rj">
          <van-button
            type="info"
            v-for="i in lei_arr"
            class="mt"
            style="width: 45vw"
            :key="i.id"
            @click="go_cp(i)"
            v-if="i.gname == '软件产品'"
          >
            {{ i.gname }}
          </van-button> 
        </div>
        <van-button
          type="info"
          v-else
          style="width: 45%"
          class="mt"
          v-for="i in lei_arr"
          :key="i.id"
          @click="go_cp(i)"
        >
          {{ i.gname }}
        </van-button>
      </div>
      <div style="height: 20px"></div>
    </div>
  </div>
</template>
<script>
import { WOW } from "wowjs";
export default {
  name: "Jiance",
  data() {
    return {
      user: "",
      info: "",
      limg_arr: [],
      nimg_arr: [],
      pid: "",
      pname: "",
      lei_arr: [],
      is_rj: false,
    };
  },
  mounted() {
    let suer = JSON.parse(localStorage.getItem("user"));
    this.user = suer;
    var wow = new WOW();
    wow.init();
    let info = this.$route.query.info;

    // this.info=info;

    // if(info.nimg){
    //    this.nimg_arr=info.nimg.split(',')
    // }
    // if(info.limg){
    //    this.limg_arr=info.limg.split(',')
    // }

    // this.get_new();

    this.get_lei();
  },
  methods: {
    go_cp(i) {
      this.$router.push({ path: "/xiang", query: { i: encodeURIComponent(JSON.stringify(i)) } });
    },
    get_lei() {
      let data = {
        type: 3,
      };
      let v = this;
      this.http.post("/products/getproductlei", data).then((res) => {
        console.log("检测分类:", res);
        if (res.data.data) {
          v.lei_arr = res.data.data;
          v.get_lei2(v.lei_arr[0].id)
        } else {
          // v.lei_arr=[]
        }
      });
    },
    
     get_lei2(id) {
      let data = {
        pid:id,
       
      };
      let v = this;
      this.http.post("/products/getproductlei", data).then((res) => {
        console.log("检测分类22:", res);
        if (res.data.data) {
          v.lei_arr = res.data.data;
        } else {
          // v.lei_arr=[]
        }
      });
    },
   
  },
};
</script>
<style scoped>
.img {
  width: 50vw;
  height: 100%;
}
.nav {
  margin: 20px 0;
}
.nav > a {
  display: inline-block;
  text-decoration: none;
  width: 120px;
  height: 45px;
  line-height: 45px;
  color: #333;
  border: 1px solid #333;
}
.nav > a.active {
  color: #1e73be;
  border-color: #1e73be;
}
.nav > a:hover {
  color: #1e73be;
  border-color: #1e73be;
}
.news-container {
  overflow: hidden;
  margin-bottom: 0;
}
.news-container > li {
  width: 55.6%;
  height: 120px;
  float: left;
  color: #333;
  text-align: right;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
}
.news-container > li:hover {
  color: #1e73be;
  border: 1px solid #1e73be;
  cursor: pointer;
}
.news-container > li:nth-of-type(2n) {
  float: right;
  text-align: left;
}
.news-container > li > .content {
  width: 60%;
  float: left;
  padding: 20px 0;
}
.news-container > li > .time {
  width: 20%;
  float: left;
  padding: 10px 0;
}
.news-container > li > .time > p {
  font-size: 30px;
  margin: 5px 0;
}
.news-container > li > .circle {
  width: 20%;
  height: 100%;
  float: left;
  position: relative;
}
.news-container > li > .circle > img {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  width: 20px;
  height: 20px;
}
.news-container > li > .circle > i {
  display: block;
  width: 1px;
  height: 100%;
  background: #707070;
}
.news-container > li:nth-of-type(2n) > .content {
  float: right;
}
.news-container > li:nth-of-type(2n) > .time {
  float: right;
}
.news-container > li:nth-of-type(2n) > .circle {
  float: right;
}
.news-container > li:nth-of-type(1) > .circle > i {
  height: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
}
.more {
  font-size: 25px;
  color: #707070;
}
.more > i {
  cursor: pointer;
}
@media screen and (max-width: 767px) {
  .news-container > li {
    width: 100%;
  }
  .news-container > li > .content {
    width: 70%;
    text-align: left;
    float: right;
  }
  .news-container > li > .time {
    width: 30%;
    text-align: left;
    float: right;
  }
  .news-container > li > .circle {
    display: none;
  }
}
</style>

